package com.zhucan.elastics.domain;

import lombok.Data;
import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;

import java.util.Date;

/**
 * @author: zhuCan
 * @date: 2019/12/19 16:42
 * @description:
 */
@Data
@Document(indexName = Employee.index, type = "_doc")
//@Mapping(mappingPath = "/mapping/es-employee.json")
public class Employee {

  public static final String index = "employee-index";


  @Id
  @Field(type = FieldType.Long)
  private Long id;

  @Field(type = FieldType.Keyword)
  private String no;

  @Field(type = FieldType.Keyword)
  private String name;

  @Field(type = FieldType.Integer)
  private Integer age;

  @Field(analyzer = "ik_max_word", type = FieldType.Text, searchAnalyzer = "ik_smart")
  private String desc;

  @Field(type = FieldType.Date, value = "entry_time")
  private Date entryTime;

  @Field(type = FieldType.Boolean)
  private Boolean deleted;

  @Field(type = FieldType.Date, value = "create")
  private Date create;


}
